package studia.figlewicz.math.library;

import java.util.Date;

public class PunktTrajektorii {
	
	private Date data;
	private Double wartosc;
	
	
	// konstruktory
	public PunktTrajektorii(Date data, Double wartosc) {
		this.data = data;
		this.wartosc = wartosc;
	}
	
	
	// gettery i settery
	public Date getData() {
		return data;
	}
	public void setData(Date data) {
		this.data = data;
	}
	public Double getWartosc() {
		return wartosc;
	}

	public void setWartosc(Double wartosc) {
		this.wartosc = wartosc;
	}


	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((data == null) ? 0 : data.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		PunktTrajektorii other = (PunktTrajektorii) obj;
		if (data == null) {
			if (other.data != null)
				return false;
		} else if (!data.equals(other.data))
			return false;
		return true;
	}


	public boolean after(Date when) {
		return data.after(when);
	}


	public boolean before(Date when) {
		return data.before(when);
	}


	public Object clone() {
		PunktTrajektorii resoult = new PunktTrajektorii((Date)data.clone(), new Double(wartosc.doubleValue()));
		return resoult;
	}


	public int compareTo(Date anotherDate) {
		return data.compareTo(anotherDate);
	}
	
	
}
 
